<template>
	<div id="cutCoin">
        <div class="bos">
            <span class="one-right"><router-link to="/rule" style="color: #fff;display: flex;align-items: center;">砍币说明<img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/WechatIMG40.png" style=" width: .16rem;height: .28rem;margin-left: .1rem;"></router-link></span>
            <span class="center">当前砍币</span>
            <p class="img">
				<img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/gold_a.png" style="width: .24rem;height: .23rem;">
				<span>{{integral}}</span>
			</p>
        </div>
		<div class="two">
			<ul>
				<li class="chou" @click="goSignin"><img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/lottery_b.png">去抽奖</li>
				<li class="dui" @click="goSignGood"><img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/duijiang_b.png">去兑换</li>
			</ul>
		</div>
		<div class="space"></div>
		<!--显示隐藏 -->
		<div class="none" v-if="show" style="padding-bottom: 4rem;">
			<div class="pict">
				<img src="https://khh-server.oss-cn-beijing.aliyuncs.com/resourse/IMG/static/coins_empty.png">
			</div>
			<h1 class="test">还没有砍币数据，快去签到吧</h1>
		</div>
		<div class="yes" v-else v-for="x in list">
			<ul>
				<li class="reward">{{x.msg}}</li>
				<li class="times">{{x.time}}</li>
			</ul>
			<span class="add">{{x.value}}</span>
		</div>
	</div>
</template>

<script>
    import config from "../config/config.js";
    import store from "../store/newStore.js";
    import share from "../share/share.js";
    import MtaH5 from 'mta-h5-analysis';
	export default{
		data(){
			return {
				show:Boolean,
                list:[],
                integral:'',
			}
		},
        computed:{
            ticket(){
                return this.$store.state.getTicket;
            }
        },
		methods:{
            ShowMyIntegral(){
                var value=JSON.stringify({"page":1,"token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/Integral/ShowMyIntegral',{
                        value:value,
                        key:key,
                        ticket:this.ticket
                },config)
                    .then(function(response) {
                        this.integral=response.data.data.integral;
                        if(response.data.data.data==''){
                            this.list=[];
                            this.show=true;
                            this.$store.commit('increment',response.data.ticket);
                        }else{
                            this.show=false;
                            this.list=response.data.data.data;
                            this.$store.commit('increment',response.data.ticket);
                        }
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
			},
			goSignin(){
                this.$router.push('/signIn/'+this.integral)
			},
            goSignGood(){
                this.$router.push('/signGood')
            }
		},
        filters:{
		  timeSerialize:function(val){
		      return getMyDate(parseInt(val));
          }
        },
		activated(){
		    share({})
			this.ShowMyIntegral();
            MtaH5.init({
                "sid":'500594815',
                "cid":'500595819',
                "autoReport":0,
                "senseHash":0,
                "senseQuery":0,
                "performanceMonitor":0,
                "ignoreParams":[]
            });
            MtaH5.pgv();
		},
        created(){

        }

	}
</script>

<style>

</style>